package com.wlyuan.open.domain.api.respository;

import com.wlyuan.core.domain.repository.BaseRepository;
import com.wlyuan.open.domain.api.OpenApi;
import com.wlyuan.open.domain.api.OpenApiPattern;
import com.wlyuan.open.domain.api.valueobj.OpenApiId;
import com.wlyuan.open.dto.api.OpenApiFilterDTO;
import com.wlyuan.utils.Page;

import java.util.List;

/**
 * @author yuanzheng
 */
public interface OpenApiRepository extends BaseRepository<OpenApi, OpenApiId> {

    /**
     * 查询
     *
     * @param filter
     * @return
     */
    Page<OpenApiId> search(OpenApiFilterDTO filter);

    /**
     * 根据url获取接口信息
     *
     * @param url
     * @param method
     * @return
     */
    OpenApi getByUrl(String url, String method);

    /**
     * @param pattern
     * @return
     */
    List<OpenApi> ofPattern(OpenApiPattern pattern);

    List<OpenApi> ofAll();

}
